Tony Arcieri

Results 2532 comments of Tony Arcieri

As a data point, here's how this was handled in `elliptic-curve`: with a trait that supports multiple overlapping impls https://docs.rs/elliptic-curve/0.14.0-rc.10/elliptic_curve/ops/trait.LinearCombination.html See also: https://docs.rs/primeorder/0.14.0-pre.7/primeorder/struct.ProjectivePoint.html#impl-LinearCombination%3C%5B(ProjectivePoint%3CC%3E,+%3CC+as+CurveArithmetic%3E::Scalar)%5D%3E-for-ProjectivePoint%3CC%3E

> The parameter for the existing trait is I: IntoIterator, but the new functionality has [_; N]. This would cause a conflicting trait implementation error. I think you missed the...

The trait in `elliptic-curve` has an `AsRef` bound on its input which can be used to produce an iterator if desired. Yes, as I said earlier the trait in `elliptic-curve`...

> AsRef produce an Iterator? I'm not following, sorry. Again, I'm talking about the `LinearCombination` trait as it exists in `elliptic-curve`. It has this `AsRef` bound: ```rust pub trait LinearCombination:...

Instead of an `AsRef` bound it could be `IntoIterator` instead. We could potentially even make a corresponding change to `elliptic-curve`.

@daxpedda here's a `elliptic-curve` PR which uses `IntoIterator` instead of `AsRef` for the `PointsAndScalars` of `LinearCombination`: https://github.com/RustCrypto/traits/pull/1936/files It's nearly API compatible with the old version except for the addition of...

Alright, seems that PR isn't helpful after all since the existing trait is generic over iterators. Looking at some real-world code examples it seems most people store the inputs in...

Yeah, I'm definitely a big fan of eliminating the error case of mismatched iterator lengths by using a 2-tuple. I'm not sure how wild people will be about updating their...

I should probably also repeat here what I noted in https://github.com/RustCrypto/traits/pull/1936, that there seems to be a fundamental tradeoff between having a trait that can work in both alloc and...

I think we should probably consider changes to `MultiscalarMul` and friends in a separate PR, and what's in this PR is fine for now as a start, though I need...