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)
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::UIntwhich internally uses 32-bit limbs on 32-bit platforms and 64-bit limbs on 64-bit platforms.Field::pow_vartimeaccepts a type that implsAsRef<[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::ReprBitsmakes 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)