libcrux icon indicating copy to clipboard operation
libcrux copied to clipboard

Check and remove redundant operations

Open karthikbhargavan opened this issue 1 year ago • 0 comments
trafficstars

  • [ ] https://github.com/cryspen/libcrux/blob/8cc3152db28d011f078e9e344d4421ec851cce9b/src/kem/kyber/arithmetic.rs#L68 The cast to i16 makes the call to get_n_least_significant_bits unnecessary

  • [ ] https://github.com/cryspen/libcrux/blob/8cc3152db28d011f078e9e344d4421ec851cce9b/src/kem/kyber/constant_time_ops.rs#L14 The value | seems to be unnecessary

  • [ ] https://github.com/cryspen/libcrux/blob/8cc3152db28d011f078e9e344d4421ec851cce9b/src/kem/kyber/constant_time_ops.rs#L54 Here the out[i] |= appears to be unnecessay. We should also check whether this masking is preserved by the compiler.

karthikbhargavan avatar Jan 07 '24 14:01 karthikbhargavan