Skip to content

Define PrimeGroupBits, a marker trait for G::PrimeGroup where G::Scalar: PrimeFieldBits #31

@kayabaNerve

Description

@kayabaNerve

I'm just annoyed with constantly importing PrimeFieldBits and writing PrimeFieldBits + PrimeGroup. I believe this would be resolvable with a few lines on my end everywhere I use the two, via:

trait PrimeGroupBits {}
impl<G: PrimeGroup> PrimeGroupBits for G where G::Scalar PrimeFieldBits {}

Yet then I need to add those lines to multiple libraries, so I'd appreciate this being introduced upstream. That may actually be the exact patch I'm proposing for here (+pub), as it means downstream libs wouldn't have to apply it themselves (which they may miss via an oversight). While PrimeGroup cannot be automatically applied as such (the Prime part of PrimeGroup, no such conveyance is made here.

I fully understand this a minor triviality and you're more than welcome to say it doesn't fit for group/doesn't have enough of a larger use case yet, but I'd appreciate it. Anything performing multiexp requires the former, if using ff properly to do so, and then PrimeGroup offers security (lack of torsion) and GroupEncoding (as frequently required by apps), hence the request for PrimeGroupBits instead of GroupBits.

Alternatively, if #25 has the preference of being over Group instead of over PrimeGroup, I believe a GroupBits for multiexp with PrimeGroupBits impl<G: GroupBits + PrimeGroup> PrimeGroupBits for G {} would be optimal.

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