Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reuse PrgFixedKeyAes128 keys within IDPF calls #525

Merged
merged 1 commit into from
Mar 22, 2023

Conversation

divergentdave
Copy link
Contributor

Stacked on top of #523.

This adds a new path to construct PrgFixedKeyAes128, reusing cSHAKE128 computations across many PRG instances. The IDPF generate and evaluate functions are then modified to use this new API, and pass the fixed key around instead of the binder. This leads to some tremendous speedups, as we are now fully exploiting the lower cost of PrgFixedKeyAes128.

idpf_codec
  Instructions:               33008 (No change)
  L1 Accesses:                45548 (-0.002195%)
  L2 Accesses:                   23 (-8.000000%)
  RAM Accesses:                 170 (+1.796407%)
  Estimated Cycles:           51613 (+0.182457%)

idpf_poplar_gen_8
  Instructions:              100885 (-85.44957%)
  L1 Accesses:               139920 (-85.30501%)
  L2 Accesses:                  107 (+2.884615%)
  RAM Accesses:                 316 (+6.397306%)
  Estimated Cycles:          151515 (-84.26760%)

idpf_poplar_gen_128
  Instructions:              663491 (-93.82247%)
  L1 Accesses:               950878 (-93.56055%)
  L2 Accesses:                  143 (+2.877698%)
  RAM Accesses:                 496 (+3.983229%)
  Estimated Cycles:          968953 (-93.44586%)

idpf_poplar_gen_2048
  Instructions:             9663954 (-94.36478%)
  L1 Accesses:             13924014 (-94.09481%)
  L2 Accesses:                 1309 (+0.153022%)
  RAM Accesses:                3147 (+0.607417%)
  Estimated Cycles:        14040704 (-94.04825%)

idpf_poplar_eval_8
  Instructions:               88080 (-75.83692%)
  L1 Accesses:               121133 (-75.77088%)
  L2 Accesses:                  113 (+2.727273%)
  RAM Accesses:                 365 (+4.285714%)
  Estimated Cycles:          134473 (-73.77406%)

idpf_poplar_eval_128
  Instructions:              466403 (-91.49974%)
  L1 Accesses:               661920 (-91.22421%)
  L2 Accesses:                  144 (-1.369863%)
  RAM Accesses:                 537 (+2.873563%)
  Estimated Cycles:          681435 (-90.98818%)

idpf_poplar_eval_2048
  Instructions:             7016253 (-92.02173%)
  L1 Accesses:              9931939 (-91.78106%)
  L2 Accesses:                 2079 (+0.096293%)
  RAM Accesses:                3233 (+0.466128%)
  Estimated Cycles:        10055489 (-91.68728%)

poplar1_shard/16        time:   [28.741 µs 28.851 µs 28.966 µs]
                        thrpt:  [67.429 KiB/s 67.696 KiB/s 67.957 KiB/s]
                 change:
                        time:   [-74.244% -73.824% -73.438%] (p = 0.00 < 0.05)
                        thrpt:  [+276.48% +282.04% +288.26%]
                        Performance has improved.
Found 4 outliers among 100 measurements (4.00%)
  2 (2.00%) high mild
  2 (2.00%) high severe
poplar1_shard/128       time:   [94.024 µs 96.512 µs 99.528 µs]
                        thrpt:  [156.99 KiB/s 161.90 KiB/s 166.18 KiB/s]
                 change:
                        time:   [-87.356% -87.101% -86.806%] (p = 0.00 < 0.05)
                        thrpt:  [+657.95% +675.27% +690.89%]
                        Performance has improved.
Found 7 outliers among 100 measurements (7.00%)
  4 (4.00%) high mild
  3 (3.00%) high severe
poplar1_shard/256       time:   [160.11 µs 162.82 µs 165.95 µs]
                        thrpt:  [188.31 KiB/s 191.93 KiB/s 195.18 KiB/s]
                 change:
                        time:   [-88.695% -88.579% -88.455%] (p = 0.00 < 0.05)
                        thrpt:  [+766.18% +775.58% +784.59%]
                        Performance has improved.
Found 10 outliers among 100 measurements (10.00%)
  4 (4.00%) high mild
  6 (6.00%) high severe

poplar1_prepare_init/16 time:   [236.69 µs 237.80 µs 239.18 µs]
                        change: [-69.108% -68.929% -68.739%] (p = 0.00 < 0.05)
                        Performance has improved.
Found 5 outliers among 100 measurements (5.00%)
  5 (5.00%) high mild
poplar1_prepare_init/128
                        time:   [705.96 µs 716.79 µs 728.91 µs]
                        change: [-88.244% -88.084% -87.895%] (p = 0.00 < 0.05)
                        Performance has improved.
Found 12 outliers among 100 measurements (12.00%)
  8 (8.00%) high mild
  4 (4.00%) high severe
poplar1_prepare_init/256
                        time:   [1.3446 ms 1.3638 ms 1.3872 ms]
                        change: [-89.411% -89.244% -89.040%] (p = 0.00 < 0.05)
                        Performance has improved.
Found 5 outliers among 100 measurements (5.00%)
  4 (4.00%) high mild
  1 (1.00%) high severe

idpf_gen/8              time:   [7.8101 µs 7.8455 µs 7.8820 µs]
                        thrpt:  [123.90 KiB/s 124.47 KiB/s 125.04 KiB/s]
                 change:
                        time:   [-82.168% -82.062% -81.952%] (p = 0.00 < 0.05)
                        thrpt:  [+454.07% +457.47% +460.78%]
                        Performance has improved.
Found 25 outliers among 100 measurements (25.00%)
  9 (9.00%) low mild
  10 (10.00%) high mild
  6 (6.00%) high severe
idpf_gen/128            time:   [50.419 µs 50.953 µs 51.624 µs]
                        thrpt:  [302.67 KiB/s 306.65 KiB/s 309.90 KiB/s]
                 change:
                        time:   [-93.491% -93.272% -93.055%] (p = 0.00 < 0.05)
                        thrpt:  [+1339.9% +1386.4% +1436.2%]
                        Performance has improved.
Found 3 outliers among 100 measurements (3.00%)
  2 (2.00%) high mild
  1 (1.00%) high severe
idpf_gen/2048           time:   [705.23 µs 707.03 µs 708.81 µs]
                        thrpt:  [352.70 KiB/s 353.59 KiB/s 354.49 KiB/s]
                 change:
                        time:   [-95.008% -94.863% -94.715%] (p = 0.00 < 0.05)
                        thrpt:  [+1792.3% +1846.5% +1903.3%]
                        Performance has improved.
Found 25 outliers among 100 measurements (25.00%)
  13 (13.00%) low severe
  1 (1.00%) low mild
  7 (7.00%) high mild
  4 (4.00%) high severe

idpf_eval/8             time:   [22.643 µs 22.733 µs 22.830 µs]
                        thrpt:  [42.776 KiB/s 42.958 KiB/s 43.128 KiB/s]
                 change:
                        time:   [-26.404% -24.697% -23.026%] (p = 0.00 < 0.05)
                        thrpt:  [+29.914% +32.797% +35.877%]
                        Performance has improved.
Found 5 outliers among 100 measurements (5.00%)
  4 (4.00%) high mild
  1 (1.00%) high severe
idpf_eval/128           time:   [373.28 µs 381.41 µs 390.49 µs]
                        thrpt:  [40.014 KiB/s 40.966 KiB/s 41.858 KiB/s]
                 change:
                        time:   [-10.725% -7.3672% -4.0925%] (p = 0.00 < 0.05)
                        thrpt:  [+4.2672% +7.9531% +12.014%]
                        Performance has improved.
Found 16 outliers among 100 measurements (16.00%)
  6 (6.00%) high mild
  10 (10.00%) high severe
idpf_eval/2048          time:   [6.4637 ms 6.5128 ms 6.5627 ms]
                        thrpt:  [38.094 KiB/s 38.386 KiB/s 38.678 KiB/s]
                 change:
                        time:   [-17.307% -14.515% -11.670%] (p = 0.00 < 0.05)
                        thrpt:  [+13.212% +16.979% +20.930%]
                        Performance has improved.
Found 1 outliers among 100 measurements (1.00%)
  1 (1.00%) high mild

Closes #511.

@divergentdave divergentdave requested a review from a team as a code owner March 16, 2023 18:08
@divergentdave divergentdave mentioned this pull request Mar 16, 2023
9 tasks
@divergentdave divergentdave force-pushed the david/vdaf-05-update-document-references branch from 43a4afd to cf53f53 Compare March 22, 2023 14:42
Base automatically changed from david/vdaf-05-update-document-references to main March 22, 2023 15:08
@divergentdave divergentdave merged commit 8fb929a into main Mar 22, 2023
@divergentdave divergentdave deleted the david/fixed-key-reuse-cshake branch March 22, 2023 15:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Optimization, IDPF: only derive the extend and convert PRG fixed keys once
2 participants