curve25519-dalek并行运算性能

curve25519-dalek:Ristretto和Curve25519上组操作的纯Rust实现 曲线25519-达力克 Ristretto和Curve25519上组操作的纯Rust实现。 curve25519-dalek是一个库,提供对Curve25519的Edwards和Montgomery形式以及原始Ristretto组的组操作。 curve25519-dalek并非旨在提供任何特定加密协议的实现。 而是,那些协议的实现(例如和 )应使用curve25519-dalek作为库。 curve25519-dalek旨在提供一个干净安全的中级API,以用于实现各种基于ECC的加密协议,例如密钥协议,签名,匿名凭据,范围证明和零知识证明系统。 特别是, curve25519-dalek实现了Ristretto,它从非素数阶的Edwards曲线构造了素数阶组。 这提供了Edwards曲线算术的速度和安全性好处,而没有因辅因子相关的抽象失配带来的陷阱。 文献资料 该semver稳定 立即下载
export RUSTFLAGS="-C target_cpu=native"
cargo bench --no-default-features --features "std avx2_backend"

与之前博客Rust curve25519-dalek密码学库性能解析对比可发现,采用avx2并行计算,性能提升明显。(测试环境为1CPU,4G内存Ubuntu16.04虚拟机)。若增加虚拟机内CPU核数和内存,性能提升更明显。

https://gist.github.com/hdevalence/d118f270ac1177fd0c357640433ab8aa 中笔记内容为:

git clone https://github.com/dalek-cryptography/curve25519-dalek.git
cd curve25519-dalek
git checkout 0.18.0
echo "nightly-2018-06-19" > rust-toolchain
export RUSTFLAGS="-C target_cpu=znver1"
cargo bench --features "nightly u64_backend" "aA+bB"
cargo bench --features "nightly avx2_backend" "aA+bB"
     Running target/release/deps/dalek_benchmarks-7f3aff4c8fe1105b
Scalar inversion        time:   [11.758 us 11.868 us 12.002 us]
                        change: [-9.7451% +5.2931% +21.841%] (p = 0.53 > 0.05)
                        No change in performance detected.
Found 20 outliers among 100 measurements (20.00%)
  1 (1.00%) high mild
  19 (19.00%) high severe

Batch scalar inversion/1
                        time:   [12.075 us 12.249 us 12.472 us]
                        change: [-9.8322% +3.8519% +17.908%] (p = 0.62 > 0.05)
                        No change in performance detected.
Found 18 outliers among 100 measurements (18.00%)
  1 (1.00%) high mild
  17 (17.00%) high severe
Batch scalar inversion/2
                        time:   [12.274 us 12.414 us 12.591 us]
                        change: [-12.058% +2.3723% +16.892%] (p = 0.76 > 0.05)
                        No change in performance detected.
Found 19 outliers among 100 measurements (19.00%)
  19 (19.00%) high severe
Batch scalar inversion/4
                        time:   [12.822 us 13.012 us 13.249 us]
                        change: [-5.5844% +7.8832% +23.099%] (p = 0.28 > 0.05)
                        No change in performance detected.
Found 22 outliers among 100 measurements (22.00%)
  3 (3.00%) high mild
  19 (19.00%) high severe
Batch scalar inversion/8
                        time:   [17.317 us 19.470 us 21.890 us]
                        change: [+10.266% +33.815% +60.232%] (p = 0.00 < 0.05)
                        Performance has regressed.
Found 5 outliers among 100 measurements (5.00%)
  4 (4.00%) high mild
  1 (1.00%) high severe
Batch scalar inversion/16
                        time:   [16.590 us 17.927 us 19.554 us]
                        change: [-16.972% -4.2389% +8.6643%] (p = 0.58 > 0.05)
                        No change in performance detected.
Found 16 outliers among 100 measurements (16.00%)
  3 (3.00%) high mild
  13 (13.00%) high severe

Montgomery pseudomultiplication
                        time:   [101.61 us 111.27 us 121.26 us]
                        change: [+13.822% +34.800% +57.787%] (p = 0.00 < 0.05)
                        Performance has regressed.
Found 3 outliers among 100 measurements (3.00%)
  3 (3.00%) high severe

RistrettoPoint compression
                        time:   [5.7802 us 6.3079 us 6.9770 us]
                        change: [-15.929% -5.1237% +5.4630%] (p = 0.41 > 0.05)
                        No change in performance detected.
Found 10 outliers among 100 measurements (10.00%)
  3 (3.00%) high mild
  7 (7.00%) high severe

                                                                            ed 5.0530 s (414k iterations)RistrettoPoint decompression
                        time:   [14.147 us 15.325 us 16.708 us]
                        change: [+90.200% +114.76% +142.62%] (p = 0.00 < 0.05)
                        Performance has regressed.
Found 20 outliers among 100 measurements (20.00%)
  4 (4.00%) low mild
  7 (7.00%) high mild
  9 (9.00%) high severe

Benchmarking Batch Ristretto double-and-encode/1: Collecting 100 samples inBatch Ristretto double-and-encode/1
                        time:   [10.898 us 11.364 us 11.916 us]
                        change: [+83.047% +108.29% +135.57%] (p = 0.00 < 0.05)
                        Performance has regressed.
Found 18 outliers among 100 measurements (18.00%)
  3 (3.00%) low mild
  6 (6.00%) high mild
  9 (9.00%) high severe
Benchmarking Batch Ristretto double-and-encode/2: Collecting 100 samples inBatch Ristretto double-and-encode/2
                        time:   [11.994 us 12.189 us 12.414 us]
                        change: [+66.956% +91.582% +120.20%] (p = 0.00 < 0.05)
                        Performance has regressed.
Found 17 outliers among 100 measurements (17.00%)
  5 (5.00%) low severe
  3 (3.00%) high mild
  9 (9.00%) high severe
Benchmarking Batch Ristretto double-and-encode/4: Collecting 100 samples inBatch Ristretto double-and-encode/4
                        time:   [25.688 us 28.581 us 31.533 us]
                        change: [+173.14% +218.59% +266.92%] (p = 0.00 < 0.05)
                        Performance has regressed.
Found 4 outliers among 100 measurements (4.00%)
  2 (2.00%) high mild
  2 (2.00%) high severe
Benchmarking Batch Ristretto double-and-encode/8: Collecting 100 samples inBatch Ristretto double-and-encode/8
                        time:   [10.729 us 10.824 us 10.950 us]
                        change: [-18.022% -9.8761% -2.6149%] (p = 0.02 < 0.05)
                        Performance has improved.
Found 9 outliers among 100 measurements (9.00%)
  6 (6.00%) high mild
  3 (3.00%) high severe
Benchmarking Batch Ristretto double-and-encode/16: Collecting 100 samples inBatch Ristretto double-and-encode/16
                        time:   [17.181 us 17.308 us 17.450 us]
                        change: [-20.514% -10.813% -1.6923%] (p = 0.04 < 0.05)
                        Performance has improved.
Found 7 outliers among 100 measurements (7.00%)
  5 (5.00%) high mild
  2 (2.00%) high severe

Benchmarking EdwardsPoint compression: Collecting 100 samples in estimated 5EdwardsPoint compression
                        time:   [3.9237 us 4.0441 us 4.1985 us]
                        change: [-14.820% -4.1252% +5.8990%] (p = 0.52 > 0.05)
                        No change in performance detected.
Found 15 outliers among 100 measurements (15.00%)
  4 (4.00%) high mild
  11 (11.00%) high severe

Benchmarking EdwardsPoint decompression: Collecting 100 samples in estimatedEdwardsPoint decompression
                        time:   [5.2305 us 5.2683 us 5.3148 us]
                        change: [-18.087% -7.4637% +1.1875%] (p = 0.20 > 0.05)
                        No change in performance detected.
Found 6 outliers among 100 measurements (6.00%)
  1 (1.00%) high mild
  5 (5.00%) high severe

Constant-time fixed-base scalar mul
                        time:   [27.322 us 28.771 us 30.642 us]
                        change: [+19.979% +42.670% +67.794%] (p = 0.00 < 0.05)
                        Performance has regressed.
Found 6 outliers among 100 measurements (6.00%)
  5 (5.00%) high mild
  1 (1.00%) high severe

Constant-time variable-base scalar mul
                        time:   [38.103 us 38.479 us 38.919 us]
                        change: [-55.822% -48.864% -41.636%] (p = 0.00 < 0.05)
                        Performance has improved.
Found 16 outliers among 100 measurements (16.00%)
  1 (1.00%) high mild
  15 (15.00%) high severe

Variable-time aA+bB, A variable, B fixed
                        time:   [34.221 us 34.633 us 35.201 us]
                        change: [-56.445% -48.551% -39.649%] (p = 0.00 < 0.05)
                        Performance has improved.
Found 19 outliers among 100 measurements (19.00%)
  2 (2.00%) high mild
  17 (17.00%) high severe

Constant-time variable-base multiscalar multiplication/1
                        time:   [44.556 us 45.450 us 46.735 us]
                        change: [-58.017% -47.328% -33.101%] (p = 0.00 < 0.05)
                        Performance has improved.
Found 3 outliers among 15 measurements (20.00%)
  3 (20.00%) high severe
Constant-time variable-base multiscalar multiplication/2
                        time:   [66.014 us 66.636 us 67.768 us]
                        change: [-62.468% -51.743% -39.304%] (p = 0.00 < 0.05)
                        Performance has improved.
Found 3 outliers among 15 measurements (20.00%)
  3 (20.00%) high severe
Constant-time variable-base multiscalar multiplication/4
                        time:   [112.00 us 118.73 us 131.32 us]
                        change: [-56.389% -44.312% -29.491%] (p = 0.00 < 0.05)
                        Performance has improved.
Found 2 outliers among 15 measurements (13.33%)
  2 (13.33%) high severe
Constant-time variable-base multiscalar multiplication/8
                        time:   [196.46 us 198.13 us 201.25 us]
                        change: [-49.214% -37.044% -21.080%] (p = 0.00 < 0.05)
                        Performance has improved.
Found 3 outliers among 15 measurements (20.00%)
  3 (20.00%) high severe
Constant-time variable-base multiscalar multiplication/16
                        time:   [370.09 us 374.42 us 381.66 us]
                        change: [-47.703% -33.950% -16.772%] (p = 0.00 < 0.05)
                        Performance has improved.
Found 3 outliers among 15 measurements (20.00%)
  3 (20.00%) high severe
Constant-time variable-base multiscalar multiplication/32
                        time:   [715.54 us 721.08 us 732.16 us]
                        change: [-50.158% -37.001% -21.577%] (p = 0.00 < 0.05)
                        Performance has improved.
Found 3 outliers among 15 measurements (20.00%)
  3 (20.00%) high severe
Constant-time variable-base multiscalar multiplication/64
                        time:   [1.4372 ms 1.5083 ms 1.6573 ms]
                        change: [-40.057% -19.325% +3.0995%] (p = 0.12 > 0.05)
                        No change in performance detected.
Constant-time variable-base multiscalar multiplication/128
                        time:   [2.8152 ms 2.8412 ms 2.8901 ms]
                        change: [-48.691% -35.667% -20.808%] (p = 0.00 < 0.05)
                        Performance has improved.
Found 3 outliers among 15 measurements (20.00%)
  3 (20.00%) high severe
Constant-time variable-base multiscalar multiplication/256
                        time:   [5.6019 ms 5.6829 ms 5.7984 ms]
                        change: [-62.533% -52.773% -38.776%] (p = 0.00 < 0.05)
                        Performance has improved.
Found 3 outliers among 15 measurements (20.00%)
  1 (6.67%) high mild
  2 (13.33%) high severe
Constant-time variable-base multiscalar multiplication/384
                        time:   [8.3317 ms 8.4071 ms 8.5425 ms]
                        change: [-46.978% -33.976% -17.981%] (p = 0.00 < 0.05)
                        Performance has improved.
Found 3 outliers among 15 measurements (20.00%)
  3 (20.00%) high severe
Constant-time variable-base multiscalar multiplication/512
                        time:   [11.157 ms 11.279 ms 11.453 ms]
                        change: [-45.586% -31.253% -11.079%] (p = 0.00 < 0.05)
                        Performance has improved.
Found 2 outliers among 15 measurements (13.33%)
  2 (13.33%) high severe
Constant-time variable-base multiscalar multiplication/768
                        time:   [16.668 ms 16.833 ms 17.052 ms]
                        change: [-45.989% -35.297% -21.922%] (p = 0.00 < 0.05)
                        Performance has improved.
Found 2 outliers among 15 measurements (13.33%)
  2 (13.33%) high severe
Constant-time variable-base multiscalar multiplication/1024
                        time:   [22.436 ms 22.603 ms 22.901 ms]
                        change: [-41.414% -32.018% -20.808%] (p = 0.00 < 0.05)
                        Performance has improved.
Found 2 outliers among 15 measurements (13.33%)
  2 (13.33%) high severe

Variable-time variable-base multiscalar multiplication/1
                        time:   [32.009 us 32.362 us 32.981 us]
                        change: [-61.484% -50.752% -37.332%] (p = 0.00 < 0.05)
                        Performance has improved.
Found 3 outliers among 15 measurements (20.00%)
  3 (20.00%) high severe
Variable-time variable-base multiscalar multiplication/2
                        time:   [39.440 us 39.801 us 40.455 us]
                        change: [-61.587% -51.092% -38.454%] (p = 0.00 < 0.05)
                        Performance has improved.
Found 4 outliers among 15 measurements (26.67%)
  1 (6.67%) low mild
  3 (20.00%) high severe
Variable-time variable-base multiscalar multiplication/4
                        time:   [52.718 us 53.413 us 54.343 us]
                        change: [-64.767% -54.260% -41.566%] (p = 0.00 < 0.05)
                        Performance has improved.
Found 3 outliers among 15 measurements (20.00%)
  3 (20.00%) high severe
Variable-time variable-base multiscalar multiplication/8
                        time:   [82.409 us 83.957 us 85.930 us]
                        change: [-63.983% -53.520% -40.592%] (p = 0.00 < 0.05)
                        Performance has improved.
Found 3 outliers among 15 measurements (20.00%)
  3 (20.00%) high severe
Variable-time variable-base multiscalar multiplication/16
                        time:   [137.99 us 139.18 us 141.70 us]
                        change: [-74.390% -66.543% -55.934%] (p = 0.00 < 0.05)
                        Performance has improved.
Found 3 outliers among 15 measurements (20.00%)
  1 (6.67%) high mild
  2 (13.33%) high severe
Variable-time variable-base multiscalar multiplication/32
                        time:   [247.69 us 249.69 us 253.99 us]
                        change: [-76.048% -69.737% -61.975%] (p = 0.00 < 0.05)
                        Performance has improved.
Found 4 outliers among 15 measurements (26.67%)
  1 (6.67%) low mild
  3 (20.00%) high severe
Variable-time variable-base multiscalar multiplication/64
                        time:   [465.25 us 470.62 us 480.29 us]
                        change: [-65.252% -56.554% -44.948%] (p = 0.00 < 0.05)
                        Performance has improved.
Found 3 outliers among 15 measurements (20.00%)
  3 (20.00%) high severe
Variable-time variable-base multiscalar multiplication/128
                        time:   [902.96 us 913.69 us 934.12 us]
                        change: [-66.331% -57.095% -45.527%] (p = 0.00 < 0.05)
                        Performance has improved.
Found 3 outliers among 15 measurements (20.00%)
  3 (20.00%) high severe
Variable-time variable-base multiscalar multiplication/256
                        time:   [1.6413 ms 1.6555 ms 1.6836 ms]
                        change: [-68.650% -59.655% -47.471%] (p = 0.00 < 0.05)
                        Performance has improved.
Found 3 outliers among 15 measurements (20.00%)
  3 (20.00%) high severe
Variable-time variable-base multiscalar multiplication/384
                        time:   [2.2856 ms 2.3174 ms 2.3753 ms]
                        change: [-66.139% -57.503% -46.852%] (p = 0.00 < 0.05)
                        Performance has improved.
Found 2 outliers among 15 measurements (13.33%)
  2 (13.33%) high severe
Variable-time variable-base multiscalar multiplication/512
                        time:   [2.8687 ms 2.9335 ms 3.0195 ms]
                        change: [-65.941% -57.506% -47.267%] (p = 0.00 < 0.05)
                        Performance has improved.
Found 2 outliers among 15 measurements (13.33%)
  2 (13.33%) high severe
Variable-time variable-base multiscalar multiplication/768
                        time:   [3.9503 ms 4.0154 ms 4.0957 ms]
                        change: [-67.592% -59.632% -48.351%] (p = 0.00 < 0.05)
                        Performance has improved.
Found 2 outliers among 15 measurements (13.33%)
  2 (13.33%) high severe
Variable-time variable-base multiscalar multiplication/1024
                        time:   [5.1086 ms 5.1795 ms 5.2720 ms]
                        change: [-65.685% -58.300% -48.651%] (p = 0.00 < 0.05)
                        Performance has improved.
Found 3 outliers among 15 measurements (20.00%)
  1 (6.67%) high mild
  2 (13.33%) high severe

Variable-time fixed-base multiscalar multiplication/1
                        time:   [31.347 us 31.774 us 32.496 us]
                        change: [-64.228% -53.773% -41.007%] (p = 0.00 < 0.05)
                        Performance has improved.
Found 3 outliers among 15 measurements (20.00%)
  3 (20.00%) high severe
Variable-time fixed-base multiscalar multiplication/2
                        time:   [37.801 us 38.247 us 38.953 us]
                        change: [-61.552% -51.240% -39.098%] (p = 0.00 < 0.05)
                        Performance has improved.
Found 3 outliers among 15 measurements (20.00%)
  3 (20.00%) high severe
Variable-time fixed-base multiscalar multiplication/4
                        time:   [49.251 us 50.144 us 51.624 us]
                        change: [-62.432% -51.077% -36.512%] (p = 0.00 < 0.05)
                        Performance has improved.
Found 3 outliers among 15 measurements (20.00%)
  3 (20.00%) high severe
Variable-time fixed-base multiscalar multiplication/8
                        time:   [72.680 us 73.607 us 75.015 us]
                        change: [-59.781% -49.568% -37.008%] (p = 0.00 < 0.05)
                        Performance has improved.
Found 3 outliers among 15 measurements (20.00%)
  3 (20.00%) high severe
Variable-time fixed-base multiscalar multiplication/16
                        time:   [121.68 us 123.98 us 127.90 us]
                        change: [-59.817% -48.515% -33.847%] (p = 0.00 < 0.05)
                        Performance has improved.
Found 2 outliers among 15 measurements (13.33%)
  2 (13.33%) high severe
Variable-time fixed-base multiscalar multiplication/32
                        time:   [214.47 us 216.94 us 220.67 us]
                        change: [-58.793% -48.412% -36.223%] (p = 0.00 < 0.05)
                        Performance has improved.
Found 3 outliers among 15 measurements (20.00%)
  3 (20.00%) high severe
Variable-time fixed-base multiscalar multiplication/64
                        time:   [403.04 us 407.96 us 416.94 us]
                        change: [-57.240% -47.620% -36.330%] (p = 0.00 < 0.05)
                        Performance has improved.
Found 3 outliers among 15 measurements (20.00%)
  3 (20.00%) high severe
Variable-time fixed-base multiscalar multiplication/128
                        time:   [773.60 us 785.60 us 804.77 us]
                        change: [-57.177% -47.069% -34.742%] (p = 0.00 < 0.05)
                        Performance has improved.
Found 3 outliers among 15 measurements (20.00%)
  3 (20.00%) high severe
Variable-time fixed-base multiscalar multiplication/256
                        time:   [1.5352 ms 1.5561 ms 1.5875 ms]
                        change: [-56.234% -45.338% -32.129%] (p = 0.00 < 0.05)
                        Performance has improved.
Found 3 outliers among 15 measurements (20.00%)
  1 (6.67%) high mild
  2 (13.33%) high severe
Variable-time fixed-base multiscalar multiplication/384
                        time:   [2.3122 ms 2.3557 ms 2.4153 ms]
                        change: [-53.630% -43.824% -32.583%] (p = 0.00 < 0.05)
                        Performance has improved.
Found 2 outliers among 15 measurements (13.33%)
  2 (13.33%) high severe
Variable-time fixed-base multiscalar multiplication/512
                        time:   [3.1217 ms 3.1856 ms 3.2986 ms]
                        change: [-72.720% -66.712% -58.409%] (p = 0.00 < 0.05)
                        Performance has improved.
Found 2 outliers among 15 measurements (13.33%)
  2 (13.33%) high severe
Variable-time fixed-base multiscalar multiplication/768
                        time:   [4.6818 ms 4.8525 ms 5.0627 ms]
                        change: [-49.745% -41.409% -30.072%] (p = 0.00 < 0.05)
                        Performance has improved.
Found 3 outliers among 15 measurements (20.00%)
  1 (6.67%) high mild
  2 (13.33%) high severe
Variable-time fixed-base multiscalar multiplication/1024
                        time:   [6.3437 ms 6.4028 ms 6.4924 ms]
                        change: [-49.096% -40.208% -27.238%] (p = 0.00 < 0.05)
                        Performance has improved.
Found 2 outliers among 15 measurements (13.33%)
  2 (13.33%) high severe

Variable-time mixed-base multiscalar multiplication (0pct dyn)/1
                        time:   [31.049 us 31.484 us 32.158 us]
                        change: [-65.267% -53.766% -39.284%] (p = 0.00 < 0.05)
                        Performance has improved.
Found 3 outliers among 15 measurements (20.00%)
  3 (20.00%) high severe
Variable-time mixed-base multiscalar multiplication (0pct dyn)/2
                        time:   [36.541 us 36.886 us 37.593 us]
                        change: [-66.401% -55.452% -40.706%] (p = 0.00 < 0.05)
                        Performance has improved.
Found 3 outliers among 15 measurements (20.00%)
  3 (20.00%) high severe
Variable-time mixed-base multiscalar multiplication (0pct dyn)/4
                        time:   [48.253 us 48.950 us 50.019 us]
                        change: [-61.536% -50.855% -35.873%] (p = 0.00 < 0.05)
                        Performance has improved.
Found 3 outliers among 15 measurements (20.00%)
  3 (20.00%) high severe
Variable-time mixed-base multiscalar multiplication (0pct dyn)/8
                        time:   [71.186 us 72.079 us 73.834 us]
                        change: [-61.147% -49.275% -34.459%] (p = 0.00 < 0.05)
                        Performance has improved.
Found 3 outliers among 15 measurements (20.00%)
  3 (20.00%) high severe
Variable-time mixed-base multiscalar multiplication (0pct dyn)/16
                        time:   [122.20 us 124.03 us 126.19 us]
                        change: [-60.455% -49.671% -35.338%] (p = 0.00 < 0.05)
                        Performance has improved.
Found 3 outliers among 15 measurements (20.00%)
  3 (20.00%) high severe
Variable-time mixed-base multiscalar multiplication (0pct dyn)/32
                        time:   [213.87 us 216.62 us 220.97 us]
                        change: [-62.166% -52.026% -40.443%] (p = 0.00 < 0.05)
                        Performance has improved.
Found 3 outliers among 15 measurements (20.00%)
  3 (20.00%) high severe
Variable-time mixed-base multiscalar multiplication (0pct dyn)/64
                        time:   [399.35 us 402.87 us 410.04 us]
                        change: [-58.633% -48.409% -35.624%] (p = 0.00 < 0.05)
                        Performance has improved.
Found 3 outliers among 15 measurements (20.00%)
  3 (20.00%) high severe
Variable-time mixed-base multiscalar multiplication (0pct dyn)/128
                        time:   [775.31 us 789.83 us 808.15 us]
                        change: [-57.471% -46.597% -31.880%] (p = 0.00 < 0.05)
                        Performance has improved.
Found 3 outliers among 15 measurements (20.00%)
  3 (20.00%) high severe
Variable-time mixed-base multiscalar multiplication (0pct dyn)/256
                        time:   [1.5270 ms 1.5364 ms 1.5553 ms]
                        change: [-57.771% -46.462% -32.774%] (p = 0.00 < 0.05)
                        Performance has improved.
Found 4 outliers among 15 measurements (26.67%)
  1 (6.67%) low mild
  3 (20.00%) high severe
Variable-time mixed-base multiscalar multiplication (0pct dyn)/384
                        time:   [2.3059 ms 2.3297 ms 2.3679 ms]
                        change: [-55.509% -44.175% -30.690%] (p = 0.00 < 0.05)
                        Performance has improved.
Found 2 outliers among 15 measurements (13.33%)
  2 (13.33%) high severe
Variable-time mixed-base multiscalar multiplication (0pct dyn)/512
                        time:   [3.0876 ms 3.1384 ms 3.2045 ms]
                        change: [-55.343% -44.852% -32.114%] (p = 0.00 < 0.05)
                        Performance has improved.
Found 2 outliers among 15 measurements (13.33%)
  2 (13.33%) high severe
Variable-time mixed-base multiscalar multiplication (0pct dyn)/768
                        time:   [4.6441 ms 4.6872 ms 4.7589 ms]
                        change: [-48.930% -39.051% -24.919%] (p = 0.00 < 0.05)
                        Performance has improved.
Found 3 outliers among 15 measurements (20.00%)
  1 (6.67%) high mild
  2 (13.33%) high severe
Variable-time mixed-base multiscalar multiplication (0pct dyn)/1024
                        time:   [6.3576 ms 6.4380 ms 6.5171 ms]
                        change: [-49.108% -42.518% -35.767%] (p = 0.00 < 0.05)
                        Performance has improved.
Found 2 outliers among 15 measurements (13.33%)
  2 (13.33%) high severe

Variable-time mixed-base multiscalar multiplication (20pct dyn)/1
                        time:   [30.854 us 31.355 us 32.049 us]
                        change: [-62.091% -51.738% -39.410%] (p = 0.00 < 0.05)
                        Performance has improved.
Found 3 outliers among 15 measurements (20.00%)
  3 (20.00%) high severe
Variable-time mixed-base multiscalar multiplication (20pct dyn)/2
                        time:   [36.635 us 37.062 us 37.832 us]
                        change: [-63.863% -54.066% -41.430%] (p = 0.00 < 0.05)
                        Performance has improved.
Found 3 outliers among 15 measurements (20.00%)
  3 (20.00%) high severe
Variable-time mixed-base multiscalar multiplication (20pct dyn)/4
                        time:   [48.938 us 49.900 us 50.923 us]
                        change: [-61.493% -51.682% -37.781%] (p = 0.00 < 0.05)
                        Performance has improved.
Found 3 outliers among 15 measurements (20.00%)
  3 (20.00%) high severe
Variable-time mixed-base multiscalar multiplication (20pct dyn)/8
                        time:   [74.475 us 75.454 us 77.029 us]
                        change: [-61.011% -50.648% -36.597%] (p = 0.00 < 0.05)
                        Performance has improved.
Found 3 outliers among 15 measurements (20.00%)
  3 (20.00%) high severe
Variable-time mixed-base multiscalar multiplication (20pct dyn)/16
                        time:   [130.68 us 133.68 us 138.13 us]
                        change: [-61.641% -50.355% -36.078%] (p = 0.00 < 0.05)
                        Performance has improved.
Found 3 outliers among 15 measurements (20.00%)
  3 (20.00%) high severe
Variable-time mixed-base multiscalar multiplication (20pct dyn)/32
                        time:   [223.37 us 226.26 us 230.39 us]
                        change: [-64.771% -54.611% -41.629%] (p = 0.00 < 0.05)
                        Performance has improved.
Found 3 outliers among 15 measurements (20.00%)
  3 (20.00%) high severe
Variable-time mixed-base multiscalar multiplication (20pct dyn)/64
                        time:   [422.99 us 430.07 us 439.75 us]
                        change: [-59.202% -47.202% -31.547%] (p = 0.00 < 0.05)
                        Performance has improved.
Found 3 outliers among 15 measurements (20.00%)
  3 (20.00%) high severe
Variable-time mixed-base multiscalar multiplication (20pct dyn)/128
                        time:   [811.05 us 817.68 us 831.99 us]
                        change: [-61.892% -50.745% -37.388%] (p = 0.00 < 0.05)
                        Performance has improved.
Found 3 outliers among 15 measurements (20.00%)
  1 (6.67%) high mild
  2 (13.33%) high severe
Variable-time mixed-base multiscalar multiplication (20pct dyn)/256
                        time:   [1.5990 ms 1.6227 ms 1.6569 ms]
                        change: [-57.979% -47.886% -36.500%] (p = 0.00 < 0.05)
                        Performance has improved.
Found 2 outliers among 15 measurements (13.33%)
  2 (13.33%) high severe
Variable-time mixed-base multiscalar multiplication (20pct dyn)/384
                        time:   [2.3941 ms 2.4231 ms 2.4629 ms]
                        change: [-57.890% -46.382% -32.828%] (p = 0.00 < 0.05)
                        Performance has improved.
Found 2 outliers among 15 measurements (13.33%)
  2 (13.33%) high severe
Variable-time mixed-base multiscalar multiplication (20pct dyn)/512
                        time:   [4.3678 ms 5.6680 ms 6.4096 ms]
                        change: [-41.770% -28.533% -12.680%] (p = 0.00 < 0.05)
                        Performance has improved.
Variable-time mixed-base multiscalar multiplication (20pct dyn)/768
                        time:   [4.8405 ms 4.8906 ms 4.9637 ms]
                        change: [-53.932% -45.604% -34.033%] (p = 0.00 < 0.05)
                        Performance has improved.
Found 3 outliers among 15 measurements (20.00%)
  3 (20.00%) high severe
Variable-time mixed-base multiscalar multiplication (20pct dyn)/1024
                        time:   [6.6044 ms 6.6966 ms 6.8190 ms]
                        change: [-50.498% -42.790% -31.922%] (p = 0.00 < 0.05)
                        Performance has improved.
Found 2 outliers among 15 measurements (13.33%)
  2 (13.33%) high severe

Variable-time mixed-base multiscalar multiplication (50pct dyn)/1
                        time:   [33.326 us 34.518 us 36.299 us]
                        change: [-59.575% -48.255% -32.768%] (p = 0.00 < 0.05)
                        Performance has improved.
Found 3 outliers among 15 measurements (20.00%)
  1 (6.67%) high mild
  2 (13.33%) high severe
Variable-time mixed-base multiscalar multiplication (50pct dyn)/2
                        time:   [40.477 us 41.291 us 42.375 us]
                        change: [-63.104% -51.908% -36.532%] (p = 0.00 < 0.05)
                        Performance has improved.
Found 3 outliers among 15 measurements (20.00%)
  3 (20.00%) high severe
Variable-time mixed-base multiscalar multiplication (50pct dyn)/4
                        time:   [54.725 us 55.666 us 56.946 us]
                        change: [-63.210% -51.949% -36.572%] (p = 0.00 < 0.05)
                        Performance has improved.
Found 3 outliers among 15 measurements (20.00%)
  3 (20.00%) high severe
Variable-time mixed-base multiscalar multiplication (50pct dyn)/8
                        time:   [81.637 us 83.847 us 86.776 us]
                        change: [-58.902% -47.557% -33.438%] (p = 0.00 < 0.05)
                        Performance has improved.
Found 3 outliers among 15 measurements (20.00%)
  3 (20.00%) high severe
Variable-time mixed-base multiscalar multiplication (50pct dyn)/16
                        time:   [136.95 us 139.26 us 142.10 us]
                        change: [-61.792% -52.150% -40.257%] (p = 0.00 < 0.05)
                        Performance has improved.
Found 3 outliers among 15 measurements (20.00%)
  3 (20.00%) high severe
Variable-time mixed-base multiscalar multiplication (50pct dyn)/32
                        time:   [240.51 us 244.52 us 248.65 us]
                        change: [-64.056% -54.555% -42.640%] (p = 0.00 < 0.05)
                        Performance has improved.
Found 3 outliers among 15 measurements (20.00%)
  3 (20.00%) high severe
Variable-time mixed-base multiscalar multiplication (50pct dyn)/64
                        time:   [448.48 us 458.40 us 469.47 us]
                        change: [-60.510% -49.722% -35.914%] (p = 0.00 < 0.05)
                        Performance has improved.
Found 3 outliers among 15 measurements (20.00%)
  3 (20.00%) high severe
Variable-time mixed-base multiscalar multiplication (50pct dyn)/128
                        time:   [861.79 us 873.04 us 888.20 us]
                        change: [-61.740% -51.493% -38.396%] (p = 0.00 < 0.05)
                        Performance has improved.
Found 3 outliers among 15 measurements (20.00%)
  3 (20.00%) high severe
Variable-time mixed-base multiscalar multiplication (50pct dyn)/256
                        time:   [1.6788 ms 1.6971 ms 1.7233 ms]
                        change: [-61.690% -52.895% -40.635%] (p = 0.00 < 0.05)
                        Performance has improved.
Found 3 outliers among 15 measurements (20.00%)
  3 (20.00%) high severe
Variable-time mixed-base multiscalar multiplication (50pct dyn)/384
                        time:   [3.0623 ms 3.4853 ms 3.8362 ms]
                        change: [-53.111% -42.374% -30.227%] (p = 0.00 < 0.05)
                        Performance has improved.
Found 1 outliers among 15 measurements (6.67%)
  1 (6.67%) high mild
Variable-time mixed-base multiscalar multiplication (50pct dyn)/512
                        time:   [3.3801 ms 3.4386 ms 3.5381 ms]
                        change: [-57.869% -46.880% -32.766%] (p = 0.00 < 0.05)
                        Performance has improved.
Found 3 outliers among 15 measurements (20.00%)
  1 (6.67%) high mild
  2 (13.33%) high severe
Variable-time mixed-base multiscalar multiplication (50pct dyn)/768
                        time:   [5.1305 ms 5.2413 ms 5.3797 ms]
                        change: [-57.582% -48.441% -37.380%] (p = 0.00 < 0.05)
                        Performance has improved.
Found 3 outliers among 15 measurements (20.00%)
  1 (6.67%) high mild
  2 (13.33%) high severe
Variable-time mixed-base multiscalar multiplication (50pct dyn)/1024
                        time:   [7.1194 ms 7.3318 ms 7.6753 ms]
                        change: [-53.294% -44.064% -33.131%] (p = 0.00 < 0.05)
                        Performance has improved.
Found 2 outliers among 15 measurements (13.33%)
  2 (13.33%) high severe

参考资料:
[1] https://gist.github.com/hdevalence/d118f270ac1177fd0c357640433ab8aa

curve25519-dalek, 在Ristretto和Curve25519上,组操作的纯 Rust 实现.zip curve25519-dalek, 在Ristretto和Curve25519上,组操作的纯 Rust 实现 curve25519-dalek 在和Curve25519上对组操作的纯铁锈实现进行收费。 curve25519-dalek 是一个图书馆,提供对爱德华兹和蒙哥马利形式的群操作,并在prime的order上。cur 立即下载

相关推荐

Curve25519 共享密钥生成 GUI:使用 curve-25519 的椭圆曲线密码术。 生成私钥乘以椭圆曲线上的给定 x 坐标点(输入)。-matlab开发

程序在提供的 x 坐标点 P(输入)和提供的 256 位随机生成的私钥 d(输入)上执行标量乘法。 程序默认为点 (x=9),它是曲线 25519 的基点。 输入应为十六进制(小端)。 程序仅使用各种私钥在几个点上进行了测试。 用户通过 Q=dP 生成用户的公钥并将其提供给另一个用户。 另一个用户提供他们的公钥,生成共享密钥,S=dQ。 共享密钥用于使用 AES (Advanced_Encryption_Standard) 等算法对两个用户之间共享的消息进行加密和解密。 该程序不是为高速而设计的,但执行速度仍然相当快。 程序使用蒙哥马利阶梯进行标量乘法。 学习椭圆曲线密码学很有趣。 了解如何轻松完成点加法和标量乘法以及为什么离散对数反转如此困难是非常有趣的。 如果有人有任何建议,请告诉我。

Curve25519加密算法

Curve25519加密算法1. Curve25519简介2. 下载及编译Curve255193.使用Curve255194. 参考 1. Curve25519简介 Curve25519 是目前最高水平的 Diffie-Hellman函数,适用于广泛的场景,由Daniel J. Bernstein教授设计。在密码学中,Curve25519是一个椭圆曲线提供128位安全性,设计用于椭圆曲线Diffi...

虎哥LoveDroid 2万+

Curve25519加解密与Ed25519加密签

Curve25519加解密与Ed25519加密签几种著名的椭圆曲线的方程和对应的实际应用 几种著名的椭圆曲线的方程和对应的实际应用 魏尔斯特拉斯曲线和基于魏尔斯特拉斯曲线的若干种椭圆曲线公钥算法 蒙哥马利曲线和基于蒙哥马利曲线的Curve25519密钥协商算法 爱德华曲线和基于爱德华曲线的Ed25519数字签名算法 ...

HORHEART的博客 1万+

STM32CubeMX实战:TIM定时器中断配置避坑指南(附100ms精准定时代码)

本文深入解析STM32CubeMX配置TIM定时器中断的常见误区与避坑技巧,重点阐述时钟源、预分频器与自动重装载值的精准计算方法。通过实战案例,提供一份可直接复用的100ms精准定时中断代码模板,并分享调试验证方法,帮助开发者构建稳定可靠的嵌入式系统心跳。

grafana8visual的博客 502

Emotion-LLaMA实战指南:从零构建多模态情感识别系统(附Python代码)

本文提供了Emotion-LLaMA多模态情感识别系统的实战指南。通过详细的步骤,指导读者从零搭建开发环境、运行本地Demo、理解模型架构,并完成数据处理与模型训练。该创新模型融合视觉、听觉与文本信息,实现更精准、接近人类理解的情感分析与推理,并附有完整的Python代码实现。

weixin_29094775的博客 423

curve25519-dalek中的MontgomeryPoint及与Scalar乘积

1. Curve25519定义 The Curve25519 function is Fp-restricted x-coordinate scalar multiplication on E(Fp2 ), where p is the prime number p = 2255 − 19 and E is the elliptic curve y2 = x3 + 486662x2 + x. 对应...

mutourend2010@gmail.com 1015

深入解析Matlab phantom函数:从基础模体到自定义头部仿真

本文深入解析了Matlab中的phantom函数,它是医学图像处理算法测试的核心工具。文章详细介绍了如何使用内置的Shepp-Logan及其改良版头部仿真模体,并重点讲解了通过自定义参数矩阵来构建专属模体的方法。通过从生成模体到模拟投影(正弦图)再到图像重建的完整实战流程,展示了phantom函数在CT等算法开发与验证中的关键作用。

m3n5b7v8c9x的博客 957

x25519-dalek 项目常见问题解决方案

x25519-dalek 项目常见问题解决方案 项目基础介绍 x25519-dalek 是一个纯 Rust 实现的 X25519 椭圆曲线 Diffie-Hellman 密钥交换库。该项目基于 curve25519-dalek 库,提供了两种级别的 API:一种是与 RFC7748 规范匹配的裸字节导向的 x25519 函数,另一种是更高级别的 Rust API,用于静态和短暂的 Diffie-H...

gitblog_00928的博客 1006

rk3588 Android HDMI IN热插拔解决

1、公司在使用 别的厂商的板卡遇到一个问题,开机我们的app自启就会闪退,后来定位发现是camera 的open出错了,这个问题的出现是因为没有插HDMI IN输入的问题导致的,所以需要对HDMI IN的热插拔进行检测,后面我把这个问题也顺利解决了。下面是我的尝试和使用的解决办法。3、话不多说,我用的是读取系统文件实现的,但是这个方法,需要有status文件的系统读权限,可以修改设备下的/vendor/etc/init/hw/init.rk3588.rc文件修改的权限,这个问题交给自己或者厂家协商解决。

qq_54089476的博客 1922

笔试题-2023-紫光展锐-数字芯片设计【纯净题目版】

笔试题-2023-紫光展锐-数字芯片设计【纯净题目版】

w0shishabi的博客 2929

Rust curve25519-dalek密码学库性能解析

https://github.com/dalek-cryptography/curve25519-dalek cargo bench Running target/release/deps/dalek_benchmarks-53fcb1faec6cb376 Scalar inversion time: [12.133 us 12.341 us 12.595 us] F...

mutourend2010@gmail.com 821

stable diffusioncontrolNet 预处理器/模型的下载及安装使用教程

首先说明,controlNet 的模型 不同于stable diffusion 模型,这一点一定要区分清楚。下面提供多个ControlNet 预处理器+ 专用模型的百度网盘下载链接,都是由群友整理贡献,但各自包含的版本不同,大家可自行选择。推荐下载紫色链接内的模型,fp16版文件更小,稍微新一些的controlnet插件还添加了对control-lora的支持(注意,要求controlnet插件的版本比12月16号新(1.1.423以上)才能正常识别),推荐下载;

代码简单说 Vue、JAVA、PHP、Node.js 熟练运用,接口、架构、性能全搞定。 3395

ed25519-dalek到curve25519-dalek源码对比:核心算法实现差异分析

ed25519-dalek 和 curve25519-dalek 均是基于椭圆曲线密码学的 Rust 库,前者专注于 Ed25519 数字签名算法,后者则实现 Curve25519 密钥交换协议。本文将从算法设计、安全特性和代码实现三个维度,深入剖析两者的核心差异,帮助开发者理解如何选择适合的密码学工具。 ## 算法定位:签名与密钥交换的技术分野 Ed25519 和 Curve25519 虽同

gitblog_00959的博客 525

docker安装部署openclaw详细教程(安装、卸载、问题处理)

摘要: 本文详细介绍了使用Docker部署OpenClaw本地AI智能体框架的全流程,包括代码下载、容器化安装、交互式配置及Token设置。Docker方案解决了环境配置复杂、依赖冲突等痛点,提供开箱即用的隔离环境。教程涵盖常见错误(如EACCES权限问题、网关启动失败、设备配对需求)的解决方案,并提供了完整的卸载指南。通过Docker部署,用户可快速构建安全、一致的AI智能体开发环境,实现大模型与本地工具的高效连接。

少说,多做 4015

Outlook Express 6 (OE6) for Win7/Win8/Win10

英文版 Outlook Express6.0, 兼容Win7/Win10/WinXP,解压就可用。

curve25519-dalek中field域内和scalar域内的运算性能对比

通过修改lib.rs文件,将field和backendmodule改为pub。 通过性能对比发现在curve25519-dalek库的代码实现,实际field域内计算速度优于scalar域内的计算性能。 针对field域内的加减乘除和scalar域内的加减乘除运算对应的bench代码如下: mod scalar_benches { use super::*; fn scalar_...

mutourend2010@gmail.com 397

大中型超市收银系统(可直接运行)

光步前台收银系统系统功能:商品销售、商品退货、挂单、收银员权限、会员销售、单品取消、整单取消、商品查询、脱机销售、脱机数据上传,基本资料下载,开钱箱、小票打印、收款结算,支持多币种付款方式(现金、储值卡、礼券、微信等),支持多种促销。运行环境:.net 4.0登陆信息用户名:1001 密码:123456内置商品信息,商品编码可输入00001000 - 00010000,测试效果相关功能键F5 结算 F9挂单 F11商品查询 F8退货 Insert单品取消 Del整单取消 F12开钱箱F2 会员 Ctrl+Z退出系统 Home 锁屏 相关源码待公开

A股量化工作台快速上手:不写代码,几分钟跑通 tick-stock-panel 全市场选股

tick-stock-panel(TSP)是一款自托管的 A 股量化工作台,把选股、回测、个股监控整合进同一个面板,行情数据全部落在你自己电脑上。这篇文章不讲线性步骤,而是按三条主线——部署、数据、策略——加一条验证主线,带你走通从开机到第一次全 A 股选股、再用回测和监控盯盘的完整闭环。全程不写代码、不装 Python 或 Node,只要你用得动浏览器。 [![tick-stock-panel

gitblog_00835的博客 341

C# WinForm 基于DirectShow.dll编写的程序,可边预览边保存视频,音频和图片

基于微软的DirectShow.dll的二次开发1.自动识别连接的摄像头跟麦克风且可以对其进行选择(默认选中第一个)2.可录制wmv和avi两种格式的视频并且都带有音频,avi可以录制的分辨率和帧数进行选择,wmv默认进行了淸晰度优化如不喜欢可去除代码中有相关提示3.可在预览点开之后进行拍照,也可边录制视频边拍照4.添加了视频和音频的压缩功能(酌情使用)这次二次开发发现C#对DirectShow的相关信息太少,这次做完也不敢藏私共享出来,还望大家指正

WINCC7.3破解文件

WINCC7.3硬件够破解文件,有需要的下载!WINCC7.3硬件够破解文件,有需要的下载!

curve25519-dalek中的Scalar模运算mul/sub/add/div

https://github.com/dalek-cryptography/curve25519-dalek/blob/master/src/backend/serial/u64/scalar.rs 中求a*b mod l的算法依据为: 1)计算m=ab; 2)计算m的montgomery_reduce值:t=mR-1 mod l; 3)计算n=tR2; 4)计算n的montgomery_redu...

mutourend2010@gmail.com 535

dalek-Curve25519 avx2并行计算学习笔记

1. 引言 Curve25519 Field Element在有限域2255−192^{255}-192255−19域内,采用64bit 串行计算时,采用的是5个FieldElement51元素来表示一个Element;若采用32-bit AVX2并行计算,则每个Element由10个FieldElement2526元素来表示。 即对于某Curve25519 Field Element a,对应的...

mutourend2010@gmail.com 871

curve25519-dalek中的montgomery_reduce算法细节

https://github.com/dalek-cryptography/curve25519-dalek/blob/master/src/backend/serial/u64/scalar.rs 中的montgomery_reduce()中的算法细节和标准的算法细节有所差异,进一步减少了内部算法的位数要求。 1. montgomery_reduction标准算法及举例 INPUT: integ...

mutourend2010@gmail.com 801

NAF(Non-adjacent form) w-NAF及其在curve25519-dalek中scalar的实现

The non-adjacent form (NAF) of a number is a unique signed-digit representation. Like the name suggests, non-zero values cannot be adjacent. For example: (0 1 1 1)2=4+2+1=7(0\ 1\ 1\ 1)_...

mutourend2010@gmail.com 4474

DLSS Swapper 使用指南:免费开源的游戏 DLSS/FSR/XeSS 文件一键换版工具

想换游戏里的 DLSS 版本,却不想等官方补丁?以前你得自己翻游戏目录、找 DLL、手动备份再替换,一步出错就可能开不了机。DLSS Swapper 是一款免费开源的 Windows 工具,自动扫描 Steam、GOG、Epic 等平台里所有支持 DLSS、FSR、XeSS 的游戏,帮你下载、替换、回滚这些文件。 ## 它是什么 DLSS Swapper 把"游戏内置的超分辨率 DLL"变成可

gitblog_00730的博客 936

curve25519-dalek中的basepoint各种表示

1. curve25519以montgomery表示下的basepoint 《Elliptic Curves for Security rfc7748》中说明,curve25519对应的形式和basepoint如下: 因此对应的代码有: /// The X25519 basepoint, in `MontgomeryPoint` format. pub const X25519_BASEPOIN...

mutourend2010@gmail.com 1022

curve25519-dalek中field reduce原理分析

对于Curve25519,其Field域内的module Fp = 2255-19。 对于64位系统 /// A `FieldElement51` represents an element of the field /// \\( \mathbb Z / (2\^{255} - 19)\\). /// /// In the 64-bit implementation, a `FieldEleme...

mutourend2010@gmail.com 855

ed25519-dalek项目迁移FAQ:开发者最关心的10个问题解答

ed25519-dalek是一个重要的加密库项目,目前该项目已迁移,为帮助开发者顺利过渡,本文整理了关于ed25519-dalek项目迁移最受关注的10个问题及解答。 ## 1. 为什么ed25519-dalek项目要进行迁移? 目前项目相关文档中未明确说明具体迁移原因,仅提示项目已迁移。一般来说,开源项目迁移可能涉及代码架构优化、维护团队调整、合并到更大项目生态等多种因素。 ## 2. ed

gitblog_01130的博客 817

ed25519-dalek项目迁移公告:重要变更与新仓库地址全解析

ed25519-dalek项目已正式迁移至新地址,本文将为您详细解析迁移的重要变更、新仓库信息及后续操作指南,帮助开发者平稳过渡。 ## 🔔 项目迁移核心通知 根据项目官方公告,ed25519-dalek仓库已完成迁移。原仓库将保持只读状态作为历史存档,所有新的开发活动、问题反馈和代码提交需转移至新仓库进行。 ## 📍 新仓库地址信息 迁移后的项目新家位于: `https://gi

gitblog_00835的博客 869
上一篇: CPU指令集——AVX2
下一篇: rust对simd支持之RUSTFLAGS
mutourend
博客等级 码龄19年 3208粉丝 1222原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值