Skip to content

update(idemix): hardening - #2136

Open
adecaro wants to merge 1 commit into
mainfrom
idemix-hardening
Open

update(idemix): hardening#2136
adecaro wants to merge 1 commit into
mainfrom
idemix-hardening

Conversation

@adecaro

@adecaro adecaro commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

This PR introduces idemix hardening.

@adecaro adecaro added this to the Q3/26 milestone Aug 4, 2026
@adecaro adecaro self-assigned this Aug 4, 2026
@github-actions

github-actions Bot commented Aug 4, 2026

Copy link
Copy Markdown

📊 Token Validation Benchmark

Comparison of this PR against the base branch. 🟢 improvement · 🔴 regression · ➖ within ±1.0% noise.

Variant Benchmark Params Workers TPS (base → PR) Δ TPS
csp BenchmarkAPIGRPC f=1, nc=4, w=token-validation-service 4 106 → 96 🔴 -8.7%
csp BenchmarkLocalTokenValidation out-tokens=2in-tokens=2 4 135 → 123 🔴 -9.3%
ipa BenchmarkAPIGRPC f=1, nc=4, w=token-validation-service 4 78 → 72 🔴 -6.7%
ipa BenchmarkLocalTokenValidation out-tokens=2in-tokens=2 4 68 → 64 🔴 -6.5%

@AkramBitar AkramBitar left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@adecaro

adecaro commented Aug 6, 2026

Copy link
Copy Markdown
Contributor Author

waiting for IBM/idemix#89 to get merged

@adecaro adecaro mentioned this pull request Aug 11, 2026
@Effi-S Effi-S self-assigned this Aug 12, 2026
Signed-off-by: Angelo De Caro <adc@zurich.ibm.com>
@LFDT-Panurus LFDT-Panurus deleted a comment from github-actions Bot Aug 12, 2026
@LFDT-Panurus LFDT-Panurus deleted a comment from github-actions Bot Aug 12, 2026
@github-actions

Copy link
Copy Markdown

📊 Token Validation Benchmark

Comparison of this PR against the base branch. 🟢 improvement · 🔴 regression · ➖ within ±1.0% noise.

Variant Benchmark Params Workers TPS (base → PR) Δ TPS
csp BenchmarkAPIGRPC f=1, nc=4, w=token-validation-service 4 118 → 107 🔴 -9.3%
csp BenchmarkLocalTokenValidation out-tokens=2in-tokens=2 4 104 → 94 🔴 -9.4%
ipa BenchmarkAPIGRPC f=1, nc=4, w=token-validation-service 4 78 → 73 🔴 -6.6%
ipa BenchmarkLocalTokenValidation out-tokens=2in-tokens=2 4 76 → 71 🔴 -6.8%

@Effi-S

Effi-S commented Aug 12, 2026

Copy link
Copy Markdown
Contributor
image

See:
From: https://github.com/IBM/mathlib/blob/v0.3.1/driver/gurvy/bls12381/bls12-381.go#L259-L263

// Mul2 computes [e]g + [f]Q via a joint Strauss-Shamir scalar multiplication.
// Benchmarked against two independent Mul calls plus an Add: allocates far less
// (1 vs ~26 allocs) but is not faster in wall-clock time, because — unlike Mul —
// it does not use the GLV endomorphism speedup, so it forgoes the ~2x speedup that
// GLV gives each individual scalar multiplication.

@Effi-S

Effi-S commented Aug 12, 2026

Copy link
Copy Markdown
Contributor
image

@Effi-S

Effi-S commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

Hi @adecaro,

Please see the full benchmarking results (Both CSP/IPA Client-Server Token Validation)
There is a clear degradation introduced by the newer mathlib version .

What do you think?

How do you want to proceed?

@Effi-S Effi-S removed their assignment Aug 12, 2026
@Effi-S
Effi-S requested a review from aaadir August 12, 2026 13:43
@aaadir

aaadir commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

"Token Validation Benchmark" also shows a performance degradation, so unless the new mathlib fixes some bugs - then why would we want to take it?

I also recall when working on the proof optimization that Claud claimed that mathlib (I guess that would be the current version) computed addition with 0 just like any other addition, rather than a trivial nop. This was one of the reasons why the optimization could exploit the 0-padded witness and field values. Now that the optimization is committed, I'm not sure there are many other places that would benefit from a trivial add-0, but may be worth an investigation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants