You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Inconsistent scalar reduction across different curve implementations
Context
I'm developing a threshold signing library that needs to be generic over different elliptic curves, specifically targeting k256 and curve25519-dalek. The library currently uses the Group trait for most operations, but I've encountered an issue with scalar reduction from U256.
Problem
When implementing generic operations like Discrete Log proofs, I need to reduce a U256 value to a curve scalar. However, there's inconsistency in how different curve implementations handle this:
For this specific case, I believe a quick Reduce<U256> and Reduce<U512> implementation should resolve it. Which seems straightforward using the existing from_bytes_mod_order and from_bytes_mod_order_wide. It will also make progress towards #492. WDYT @tarcieri?
It could potentially be implemented, although elliptic-curve isn't currently a dependency and it might contain some assumptions about curves being of prime order
Inconsistent scalar reduction across different curve implementations
Context
I'm developing a threshold signing library that needs to be generic over different elliptic curves, specifically targeting
k256
andcurve25519-dalek
. The library currently uses theGroup
trait for most operations, but I've encountered an issue with scalar reduction from U256.Problem
When implementing generic operations like Discrete Log proofs, I need to reduce a U256 value to a curve scalar. However, there's inconsistency in how different curve implementations handle this:
k256::Scalar
implements theReduce
trait.curve25519_dalek::Scalar
doesn't implementReduce
. Instead, it provides:from_bytes_mod_order
FromUniformBytes
traitThere's no common trait that both curves implement for modular reduction, which complicates writing generic code.
Questions
Reduce
trait forcurve25519-dalek::Scalar
?Additional Information
0.13.2
4.1.3
usinggroup
feature.Any guidance or suggestions would be greatly appreciated. Thank you!
The text was updated successfully, but these errors were encountered: