dalek-cryptography / curve25519-dalek

A pure-Rust implementation of group operations on Ristretto and Curve25519
Other
853 stars 422 forks source link

Add PrimeFieldBits support to Scalar #579

Closed kayabaNerve closed 10 months ago

kayabaNerve commented 10 months ago

The char_le_bits function is a hack I don't legitimately recommend. I just felt it'd be better to make a PR, which works, than to solely file an issue requesting it as a feature.

kayabaNerve commented 10 months ago

Sorry for this PR being a mess. I'm unsure why the no-std CIs are failing.

tarcieri commented 10 months ago

It's possible that bitvec isn't working on no_std for whatever reason? Though I'm not sure why there isn't a proper compiler error.

Regardless it would probably be good to split this out into a bits feature that enables ff/bits so that bitvec doesn't become a mandatory dependency for users of the group feature.

kayabaNerve commented 10 months ago

I use ff, with bits, on libraries with no-std targets so that shouldn't be it... (though I may technically solely test them on alloc, not no-std).

I'll make bits a feature. group-bits for clarity? It's the bits of dalek's group functionality (despite technically affecting ff).

pinkforest commented 10 months ago

It's because we don't do additional cargo hack of the features via std build and we only do it via no_std that detects any errors via features - e.g. red herring that just appears via no_std run which has the feature tested but not in std run we don't do additional duplicate run :)

rozbb commented 10 months ago

This looks good to me, thanks! Could you add an item in the changelog for this feature?

kayabaNerve commented 10 months ago

Thanks for moving this forward before I had the chance, rozbb :) And thanks pinkforest for the actual edit needed.