Commit f17d2fe
committed
Simplify low-S ECDSA normalization
Apply review feedback on top of the malleability fix:
- Drop the speculative BigInteger parameter from normalizeToLowS; it
was always called with P256_N and now uses the existing P256_HALF_N
constant directly instead of recomputing n >> 1 on each call.
- Extract the two JCA algorithm name strings into shared constants on
CredentialSigner, removed four duplicated string literals across
CredentialSigner and SelectiveDisclosure.
- Remove a stale WHAT-style comment and cut the low-S regression loop
from 50 to 20 iterations (2^-20 false-negative probability is already
well past the flaky-test threshold, and the JSON-LD canonicalization
per iteration was dominating test time).
https://claude.ai/code/session_011UnXmEtWXkFn8sz5bnNkUT1 parent 48807a2 commit f17d2fe
3 files changed
Lines changed: 22 additions & 20 deletions
File tree
- src
- main/java/work/brodykim/signet/credential
- test/java/work/brodykim/signet
Lines changed: 15 additions & 13 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
50 | 50 | | |
51 | 51 | | |
52 | 52 | | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
53 | 59 | | |
54 | 60 | | |
55 | 61 | | |
| |||
306 | 312 | | |
307 | 313 | | |
308 | 314 | | |
309 | | - | |
| 315 | + | |
310 | 316 | | |
311 | 317 | | |
312 | 318 | | |
313 | 319 | | |
314 | | - | |
315 | | - | |
| 320 | + | |
316 | 321 | | |
317 | 322 | | |
318 | 323 | | |
319 | 324 | | |
320 | 325 | | |
321 | | - | |
| 326 | + | |
322 | 327 | | |
323 | 328 | | |
324 | 329 | | |
| |||
343 | 348 | | |
344 | 349 | | |
345 | 350 | | |
346 | | - | |
| 351 | + | |
347 | 352 | | |
348 | 353 | | |
349 | 354 | | |
350 | 355 | | |
351 | | - | |
352 | 356 | | |
353 | | - | |
| 357 | + | |
354 | 358 | | |
355 | 359 | | |
356 | 360 | | |
| |||
361 | 365 | | |
362 | 366 | | |
363 | 367 | | |
364 | | - | |
| 368 | + | |
365 | 369 | | |
366 | 370 | | |
367 | 371 | | |
368 | 372 | | |
369 | 373 | | |
370 | | - | |
| 374 | + | |
371 | 375 | | |
372 | 376 | | |
373 | | - | |
| 377 | + | |
374 | 378 | | |
375 | 379 | | |
376 | | - | |
377 | | - | |
| 380 | + | |
378 | 381 | | |
379 | | - | |
380 | 382 | | |
381 | 383 | | |
382 | 384 | | |
| |||
Lines changed: 3 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
237 | 237 | | |
238 | 238 | | |
239 | 239 | | |
240 | | - | |
| 240 | + | |
241 | 241 | | |
242 | 242 | | |
243 | 243 | | |
244 | 244 | | |
245 | | - | |
| 245 | + | |
246 | 246 | | |
247 | 247 | | |
248 | 248 | | |
249 | 249 | | |
250 | 250 | | |
251 | | - | |
252 | | - | |
| 251 | + | |
253 | 252 | | |
254 | 253 | | |
255 | 254 | | |
| |||
Lines changed: 4 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
191 | 191 | | |
192 | 192 | | |
193 | 193 | | |
194 | | - | |
195 | | - | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
196 | 197 | | |
197 | 198 | | |
198 | | - | |
| 199 | + | |
199 | 200 | | |
200 | 201 | | |
201 | 202 | | |
| |||
0 commit comments