Commit 8a17534
authored
Add AVX2 multi-block Keccak absorb with jagged state layout (#46)
Add AVX2 multi-block Keccak absorb with jagged state layout
Implement SIMD-optimized SHA3/Keccak absorb that fuses data XOR +
permutation into a single loop with one gather/scatter, eliminating
the per-block gather/scatter overhead that made the initial AVX2
permutation slower than scalar.
Key changes:
- New KeccakF1600Avx2Absorb.inc: multi-block absorb assembly using
Andy Polyakov's plane-per-register technique (CRYPTOGAMS/XKCP),
with jagged buffer on stack and A_JAGGED offset table for XOR
- New SimdProc5Begin.inc: shared 5-parameter ABI prologue
- Extended K_KECCAK with Jagged offset table mapping standard state
indices to jagged buffer positions
- Added TKeccakF1600AbsorbProc dispatch (AVX2 + scalar fallback)
- Overrode TSHA3.TransformBytes for multi-block absorb path
- Consolidated TransformBlock to delegate to KeccakF1600_Absorb,
making scalar absorb endian-safe via le64_copy1 parent 79ff5d4 commit 8a17534
4 files changed
Lines changed: 544 additions & 11 deletions
File tree
- HashLib/src
- Crypto
- Include/Simd
- Common
- SHA3
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
48 | 48 | | |
49 | 49 | | |
50 | 50 | | |
| 51 | + | |
| 52 | + | |
51 | 53 | | |
52 | 54 | | |
53 | 55 | | |
| |||
404 | 406 | | |
405 | 407 | | |
406 | 408 | | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
407 | 415 | | |
408 | | - | |
409 | | - | |
| 416 | + | |
| 417 | + | |
410 | 418 | | |
411 | | - | |
412 | | - | |
413 | | - | |
414 | | - | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
415 | 437 | | |
416 | | - | |
417 | | - | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
| 441 | + | |
| 442 | + | |
418 | 443 | | |
419 | 444 | | |
420 | | - | |
421 | | - | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
422 | 450 | | |
423 | 451 | | |
424 | 452 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| 9 | + | |
| 10 | + | |
9 | 11 | | |
10 | 12 | | |
11 | 13 | | |
| 14 | + | |
12 | 15 | | |
13 | 16 | | |
14 | 17 | | |
15 | 18 | | |
16 | 19 | | |
| 20 | + | |
17 | 21 | | |
18 | 22 | | |
19 | 23 | | |
| |||
377 | 381 | | |
378 | 382 | | |
379 | 383 | | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
380 | 408 | | |
381 | 409 | | |
382 | 410 | | |
| |||
388 | 416 | | |
389 | 417 | | |
390 | 418 | | |
| 419 | + | |
391 | 420 | | |
392 | 421 | | |
393 | 422 | | |
| |||
427 | 456 | | |
428 | 457 | | |
429 | 458 | | |
430 | | - | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
431 | 464 | | |
432 | 465 | | |
433 | 466 | | |
| |||
440 | 473 | | |
441 | 474 | | |
442 | 475 | | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
| 483 | + | |
| 484 | + | |
| 485 | + | |
| 486 | + | |
| 487 | + | |
443 | 488 | | |
444 | 489 | | |
445 | 490 | | |
| |||
453 | 498 | | |
454 | 499 | | |
455 | 500 | | |
| 501 | + | |
456 | 502 | | |
457 | 503 | | |
458 | 504 | | |
459 | 505 | | |
460 | 506 | | |
| 507 | + | |
461 | 508 | | |
462 | 509 | | |
463 | 510 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
0 commit comments