niekbouman / ctbignum

Library for Multiprecision Compile-Time and Run-Time Arithmetic (including Modular Arithmetic)
Apache License 2.0
112 stars 11 forks source link

Using a bitshift with a shift larger than the limb bitwidth doesn't work #55

Open aldogunsing-rl opened 1 week ago

aldogunsing-rl commented 1 week ago

Currently, shift_right (and probably shift_left as well) don't support a shift larger than the limb bitwidth and when used give an undefined result. It would be nice if this was supported, or at least checked so an error would be given whenever it is tried.

johnmcfarlane commented 1 week ago

Have you tried with UBSan enabled?