Skip to content

Link from AffinePoint,ProjectivePoint and Scalar to curve type #1995

@daxpedda

Description

@daxpedda

I was considering finally moving the GroupDigest trait to ProjectivePoint itself.
This wasn't really possible before because GroupDigest still included hash_to_scalar(), but this is moved away in RustCrypto/elliptic-curves#1389.

However, I noticed that there is no way to access the curve type itself, e.g. NistP256, from ProjectivePoint. The same applies to Scalar. This would be needed to access traits that are on the curve type but not on the point or scalar. In this case MapToCurve::SecurityLevel.

Therefor, I propose adding a new trait:

pub trait AssociatedCurve {
    type Curve: Curve;
}

which would be implemented for AffinePoint,ProjectivePoint and Scalar.

Ideally, this could just be an associated type on Curve, CurveAffine and Field, but they don't seem to deal with this sort of ZST for a curve AFAICS. Its also moving quite slow in comparison to RustCrypto.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions