mirror of
https://github.com/saymrwulf/curve25519-dalek-source.git
synced 2026-09-04 20:24:10 +00:00
Delay shuffles that cross the "Great Wall of Intel".
This commit is contained in:
parent
33aa544cf4
commit
06766bfdea
1 changed files with 6 additions and 6 deletions
|
|
@ -71,14 +71,14 @@ impl Identity for ExtendedPoint {
|
|||
|
||||
impl ExtendedPoint {
|
||||
pub fn double(&self) -> ExtendedPoint {
|
||||
// Set tmp0 = (X1 Y1 X1 Y1)
|
||||
let mut tmp0 = self.0.shuffle(Shuffle::ABAB);
|
||||
// (Y1 X1 T1 Z1) -- uses vpshufd (1c latency @ 1/c)
|
||||
let mut tmp0 = self.0.shuffle(Shuffle::BADC);
|
||||
|
||||
// Set tmp1 = (Y1 X1 Y1 X1)
|
||||
let mut tmp1 = tmp0.shuffle(Shuffle::BADC);
|
||||
// (X1+Y1 X1+Y1 X1+Y1 X1+Y1) -- can use vpinserti128
|
||||
let mut tmp1 = (self.0 + tmp0).shuffle(Shuffle::ABAB);
|
||||
|
||||
// Set tmp0 = (X1 Y1 Z1 X1+Y1)
|
||||
tmp0 = self.0.blend(&(tmp0 + tmp1), Lanes::D);
|
||||
// (X1 Y1 Z1 X1+Y1)
|
||||
tmp0 = self.0.blend(&tmp1, Lanes::D);
|
||||
|
||||
tmp1 = F51x4Reduced::from(tmp0).square();
|
||||
// Now tmp1 = (S1 S2 S3 S4)
|
||||
|
|
|
|||
Loading…
Reference in a new issue