Skip to content

Commit

Permalink
cargo fmt.
Browse files Browse the repository at this point in the history
  • Loading branch information
xvzcf committed Apr 30, 2024
1 parent a473380 commit eaafa92
Showing 1 changed file with 6 additions and 14 deletions.
20 changes: 6 additions & 14 deletions libcrux-ml-kem/src/simd/simd256.rs
Original file line number Diff line number Diff line change
Expand Up @@ -227,16 +227,14 @@ fn ntt_layer_1_step(v: SIMD256Vector, zeta1: i32, zeta2: i32) -> SIMD256Vector {
let zeta_multipliers = _mm256_shuffle_epi32(v.elements, 0b11_10_11_10);

let rhs = _mm256_mullo_epi32(zeta_multipliers, zetas);
let rhs = montgomery_reduce(SIMD256Vector { elements: rhs}).elements;
let rhs = montgomery_reduce(SIMD256Vector { elements: rhs }).elements;

let lhs = _mm256_shuffle_epi32(v.elements, 0b01_00_01_00);

_mm256_add_epi32(rhs, lhs)
};

SIMD256Vector {
elements: result
}
SIMD256Vector { elements: result }
}

#[inline(always)]
Expand All @@ -246,16 +244,14 @@ fn ntt_layer_2_step(v: SIMD256Vector, zeta: i32) -> SIMD256Vector {
let zeta_multipliers = _mm256_permute4x64_epi64(v.elements, 0b11_10_11_10);

let rhs = _mm256_mullo_epi32(zeta_multipliers, zetas);
let rhs = montgomery_reduce(SIMD256Vector { elements: rhs}).elements;
let rhs = montgomery_reduce(SIMD256Vector { elements: rhs }).elements;

let lhs = _mm256_permute4x64_epi64(v.elements, 0b01_00_01_00);

_mm256_add_epi32(rhs, lhs)
};

SIMD256Vector {
elements: result
}
SIMD256Vector { elements: result }
}

#[inline(always)]
Expand All @@ -275,9 +271,7 @@ fn inv_ntt_layer_1_step(v: SIMD256Vector, zeta1: i32, zeta2: i32) -> SIMD256Vect
_mm256_blend_epi32(sums, products_reduced, 0b1_1_0_0_1_1_0_0)
};

SIMD256Vector {
elements: result
}
SIMD256Vector { elements: result }
}

#[inline(always)]
Expand All @@ -297,9 +291,7 @@ fn inv_ntt_layer_2_step(v: SIMD256Vector, zeta: i32) -> SIMD256Vector {
_mm256_blend_epi32(sums, products_reduced, 0b1_1_1_1_0_0_0_0)
};

SIMD256Vector {
elements: result
}
SIMD256Vector { elements: result }
}

#[inline(always)]
Expand Down

0 comments on commit eaafa92

Please sign in to comment.