eleanor-em / rust-elgamal

A straightforward implementation of ElGamal using the Ristretto255 elliptic curve group.
Other
8 stars 4 forks source link

Add must_use to rerandomise methods #2

Closed tcerqueira closed 3 months ago

tcerqueira commented 3 months ago

I think if one calls a rerandomise function and ignores the returned ciphertext, it is likely a bug. This attribute macro warns if the the return value is unused.

I added only for these two methods because it's a Ciphertext -> Ciphertext transformation, and one might mistakenly assume it mutates the input Ciphertext.

Yes, I did this mistake 🥲

tcerqueira commented 3 months ago

Hold on, my rustfmt changed the order of the imports

eleanor-em commented 3 months ago

Great, thanks very much!