Skip to content

Could Field::pow_vartime take a slice of word-sized "limbs" as the exponent? #85

Description

@tarcieri

Over on RustCrypto/traits#1024 we're discussing how to represent a parameter which is ultimately passed to Field::pow_vartime.

I was suggesting representing it as a crypto_bigint::UInt which internally uses 32-bit limbs on 32-bit platforms and 64-bit limbs on 64-bit platforms.

Field::pow_vartime accepts a type that impls AsRef<[u64]> as an exponent, regardless of the target pointer width.

I think it might make sense to allow customizing that in some way to make it easier to support 32-bit limbs on 32-bit platforms.

For example, PrimeFieldBits::ReprBits makes this possible. I'm curious if a similar associated type could be added to describe an array-of-limbs which would let implementations vary the word size based on the target.

(and really, in practice I'd use the same type as PrimeFieldBits::ReprBits)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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