elliptic-curves icon indicating copy to clipboard operation
elliptic-curves copied to clipboard

chore: remove unnecessary Default bound on T in hash_to_field

Open Snezhkko opened this issue 3 months ago • 3 comments

Drop the T: Default bound from hash2curve/src/hash2field.rs::hash_to_field(), since T is only used via Reduce<Array<u8, L>> (T::reduce(&tmp)) and never instantiated with T::default(). The Reduce trait from elliptic_curve::ops does not require Default, and call sites rely solely on reduction from expanded message bytes. This change relaxes the generic constraints without altering behavior or API semantics. The Default bound in hash2curve/src/map2curve.rs is intentionally preserved because mapping implementations construct Array::<FieldElement, N>::default(), which requires FieldElement: Default.

Snezhkko avatar Nov 17 '25 10:11 Snezhkko

bot?

baloo avatar Nov 18 '25 17:11 baloo

bot?

alive person

Snezhkko avatar Nov 18 '25 17:11 Snezhkko

cc @daxpedda

tarcieri avatar Nov 18 '25 18:11 tarcieri