data61 / cuda-fixnum

Extended-precision modular arithmetic library that targets CUDA.
Other
41 stars 28 forks source link

Support different moduli in different slots #24

Closed unzvfu closed 6 years ago

unzvfu commented 6 years ago

Currently we only support a single fixed modulus in the Montgomery arithmetic, but there's no reason why we shouldn't also support moduli that vary with the slot.

This would involve doing all the Montgomery preprocessing on the GPU, which is a non-trivial amount of work.

unzvfu commented 6 years ago

One way to do this might be to make Monty arithmetic into a fixnum_impl and then combine it with common functionality from an RNS fixnum_impl.

unzvfu commented 6 years ago

This is possible now that all precomputations are done on the device (see ff63e4c5789159d11c2d810a28cbb07a7dbbe4bc).